<!DOCTYPE html>
<html>
<head>
<link href="./css/modern.css" rel="stylesheet">
<link href="./css/style-student-group.css" rel="stylesheet" type="text/css">
</head>

<script>
function validateTextFields()
{

	var TAID = document.forms[1]["taid"].value;
	var firstname = document.forms[1]["firstName"].value;
	var lastname = document.forms[1]["lastName"].value;
	var email = document.forms[1]["email"].value;
	
	if(TAID == "")
	{
		alert("Please fill in the TAID Field!!");
		return false;
	}
	
	else if(firstname == "")
	{
		alert("Please fill in the First Name Field!!");
		return false;
	}
	
	else if(lastname == "")
	{
		alert("Please fill in the Last Name Field!!");
		return false;
	}
	
	else if(email == "")
	{
		alert("Please fill in the E-mail Field!!");
		return false;
	}
	return true;
}
</script>

<%
	String firstname = (String) request.getAttribute("firstname");
	String lastname = (String) request.getAttribute("lastname");
	String courseNumber = (String) request.getAttribute("courseNumber");
	String sectionNumber = (String) request.getAttribute("sectionNumber");
%>

<body>
	<div id="container">
		<div id="header">
			<br>
			<h1 id="main-title">
				<b><font color="000000">EECE Student Group Assessments</b></font>
			</h1>
			<h2>
				Welcome <%=firstname%>  <%=lastname%> to <%=courseNumber%> Section <%=sectionNumber%>!
				<a href="index.html">
					<p align="right">
						<font size="5">Logout</font>
					</p>
				</a>
			</h2>
		</div>
		<div id="body">
		
			<form id=form method="get" action="ProfViewClassListServlet">
             	<a href = "javascript:;" onclick="document.getElementById('form').submit();" class="back-button big page-back">
             		<input type = "hidden" name = "firstname" value = <%=firstname%>>
					<input type = "hidden" name = "lastname" value = <%=lastname%>>	
					<input type = "hidden" name = "courseNumber" value = "<%=courseNumber%>">
					<input type = "hidden" name = "sectionNumber" value = <%=sectionNumber%>>	
             	</a>
            </form>
             <div id="innerBody" class="page-region-content tiles">
			<h1>Add Teaching Assistant</h1>
			<p>Please fill in all fields.</p>
			<form name="form1" method="get" action ="ProfAddStudentTAServlet" onsubmit = "return validateTextFields()">
			<p>TAID:</p>
			<p>
			  <input type="text" name="taid">
			</p>
			<p>First Name:</p>
			<p>
			  <input type="text" name="firstName">
			</p>
			<p>Last Name:</p>
			<p>
			  <input type="text" name="lastName">
			</p>
			<p>E-mail:</p>
			<p>
			  <input type="text" name="email">
			</p>
			  <input type="submit" name= "button" value="Add TA">
			  <input type = "hidden" name = "firstname" value = <%=firstname%>>
			  <input type = "hidden" name = "lastname" value = <%=lastname%>>	
			  <input type = "hidden" name = "courseNumber" value = "<%=courseNumber%>">
			  <input type = "hidden" name = "sectionNumber" value = <%=sectionNumber%>>	
		  </form>
			<br>
			</div>
		</div>
		<div id="footer">
			&copy;UBC Electrical and Computer Engineering. Styled with <a
				href="http://metroui.org.ua">Metro UI CSS</a>
		</div>
	</div>
</body>
</html>